package com.nowcoder.code.lcof;

public class JZ71 {


    public static void main(String[] args) {
        for (int i = 1; i <= 20; i++) {
            System.out.println(new JZ71().jumpFloorII(i));
        }
    }

    public int jumpFloorII(int number) {

        int[] is = new int[number + 2];
        is[0] = 1;
        is[1] = 2;
        for (int i = 2; i < number; i++) {
            is[i] = 2*is[i - 1] ;
        }
        return is[number - 1];


    }
    public int jumpFloorII2(int number) {

        int[] is = new int[number + 2];
        is[0] = 1;
        is[1] = 2;
        for (int i = 2; i < number; i++) {
            int sum = 1;
            for (int j = 0; j < i; j++) {
                sum = sum + is[j] ;
            }
            is[i] = sum;

        }
        return is[number - 1];


    }


}
